pp108 : Mutex and Override rules

Mutex and Override rules

This topic describes the mutually exclusive rules and the override rules.

Mutually Exclusive(Mutex) rules


You can set a particular rule (source rule) to be mutually exclusive (mutex) to one or more rules. This way, if the source rule happens to trigger first, and the condition is satisfied, the mutex rule will not trigger. Likewise, if the rule that is set to be mutually exclusive happens to trigger first, the source rule will not trigger

Example of Mutex rules


A customer has placed an order, and you have designed your application to send a request for the ordered items to two different warehouses. The process of procuring items from each warehouse differs. For this purpose, you have designed two separate rules to handle the operations. According to the application logic, if a particular warehouse responds to the request, you would not want the other rule to trigger. In such cases, you can use the mutex feature.

Note:

  • Rules that are mutually exclusive to each other should be of the same type.
  • When you set a rule to be mutually exclusive to another rule, the rule priority is ignored.
  • You cannot set a constraint rule having internal actions, to be mutually exclusive with constraint rules having external actions, and vice versa.

Overriding Rules


You can set a rule to override another rule. This way, even if a rule is acting on an object, you can choose to override that rule with another rule.

Example of Overriding rules


You have designed your application to accept orders from customers and internal users. You want to design separate rules to handle each of these entities. But you want to give preference to the rule which is triggered when an order is placed by a customer. From this perspective, you have designed two rules: one rule would handle the orders received by the customer, and the other would handle the orders received by internal users. You can use the override feature so that in the event of both the entities (customer and internal user) placing an order at the same time, the rule which processes the order placed by the customer gets preference and will be implemented. The rule processing the orders received by the internal users will be overridden and the corresponding action will be not be carried out, eventhough the rule is successfully executed. In case the rule placing the orders for the customer does not execute or the rule fails, the rule which places the orders for the internal customer will be executed.

Note:

  • You cannot override a constraint rule having internal actions with constraint rules having external actions, and vice versa.